package response

import (
	"context"
	"github.com/zeromicro/go-zero/rest/httpx"
	"net/http"
)

func Response(ctx context.Context, w http.ResponseWriter, rsp any, err error) {
	if err != nil {
		w.WriteHeader(http.StatusInternalServerError)
		return
	}

	httpx.OkJsonCtx(ctx, w, rsp)
}
